package com.wgc.search.controller;

import com.wgc.entity.Result;
import com.wgc.search.service.SearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;
/**
 * 关键词搜索
 */
@RestController
@RequestMapping("/search")
public class SearchController {
    @Autowired
    private SearchService searchService;

    /**
     * 全文检索
     *
     * @param paramMap
     * @return
     */
    @PostMapping("/select")
    public Result search(@RequestBody Map<String, String> paramMap) throws Exception {
        Map search = searchService.search(paramMap);
        return new Result("查询成功", search);
    }

}
